import 'package:core_demo/page/test/first/first_view_model.dart';
import 'package:flutter/material.dart';
import 'package:core/core.dart';

import '../../../helper/config/route.dart';

late FirstViewModel _model;

class FirstPage extends StatelessWidget {

  const FirstPage({super.key});

  @override
  Widget build(BuildContext context) {
    return CoreProvider<FirstViewModel>(
      model: FirstViewModel(),
      builder: (context, model, child){
        _model = model;
        return BaseRoot(
          title: '这是第一个页面',
          body: Center(
            child: Column(
              mainAxisSize: MainAxisSize.min,
              children: [
                InkWell(
                  onTap: (){
                    NavigatorHelper.pushNamed(context, RouteName.second);
                  },
                  child: Text('这是第一个页面', style: Colors.red.toStyle(28.px).withBold),
                ),
                Container(
                  padding: EdgeInsets.symmetric(horizontal: 20.px, vertical: 10.px),
                  margin: EdgeInsets.symmetric(horizontal: 20.px),
                  decoration: BoxDecoration(
                    border: Border.all(color: Colors.grey, width: 1.px),
                    borderRadius: BorderRadius.circular(8.px),//circle
                  ),
                  child: InputWidget(),
                ),
              ],
            ),
          ),
        );
      },
    );
  }
}